//
//  GJBMKSearchUtil.m
//  xmgjAppFront
//
//  Created by Zeki on 2020/7/27.
//  Copyright © 2020 guojutech. All rights reserved.
//

#import "GJBMKSearchUtil.h"
#import <AMapFoundationKit/AMapFoundationKit.h>
#import <AMapSearchKit/AMapSearchKit.h>

@interface GJBMKSearchUtil ()<AMapSearchDelegate>
@property (nonatomic, strong)AMapSearchAPI *routeSearch;
@end

@implementation GJBMKSearchUtil

+ (instancetype)shareInstance{
  static GJBMKSearchUtil *onceToken = nil;
  static dispatch_once_t once_t;
  dispatch_once(&once_t, ^{
    onceToken = [GJBMKSearchUtil new];
  });
  return onceToken;
}
- (instancetype)init
{
  self = [super init];
  if (self) {
    
  }
  return self;
}


- (void)searchRouteWithPoints:(NSArray *)addresPoints{
  AMapDrivingRouteSearchRequest *navi = [[AMapDrivingRouteSearchRequest alloc] init];

  navi.requireExtension = YES;
  navi.strategy = 5;
  /* 出发点. */
  navi.origin = [AMapGeoPoint locationWithLatitude:0
                                         longitude:0];
  /* 目的地. */
  navi.destination = [AMapGeoPoint locationWithLatitude:0
                                              longitude:0];
}

#pragma mark -- BMKRouteSearchDelegate
- (void)onRouteSearchDone:(AMapRouteSearchBaseRequest *)request response:(AMapRouteSearchResponse *)response{
  
}


- (void)dealloc{
  
}
#pragma mark -- getter
- (AMapSearchAPI *)routeSearch{
  if (!_routeSearch) {
    _routeSearch = [[AMapSearchAPI alloc] init];
    _routeSearch.delegate = self;
  }
  return _routeSearch;
}
@end
